package com.eportal.service;

import com.eportal.domain.Sysopt;
import com.eportal.domain.TAgent;
import com.eportal.domain.TCommunity;
import com.eportal.entity.SysoptEntity;
import com.eportal.exception.NotUniqueException;
import com.eportal.vo.controller.background.sysopt.SysoptSelectListVO;
import com.framework.jqgrid.JqGridPager;

import java.lang.reflect.InvocationTargetException;
import java.util.List;
import java.util.Map;

public interface SysOptService extends BaseService<SysoptEntity>{

    /**
     * 保存
     *
     * @param user
     */
	Sysopt save(Sysopt user)throws Exception;

    /**
     * 删除
     *
     * @param ids
     */
    void delete(List<Long> ids);

    Sysopt get(Long id);

    /**
     * 更新
     *
     * @param user
     */
    void update(Sysopt user) throws InvocationTargetException, IllegalAccessException, Exception;


    /**
     * 带分页显示
     *
     * @param jqGridPager
     * @return
     */
    List<Map<String, Object>> list(JqGridPager jqGridPager, String sql);

    List<Sysopt> find(Map<String, Object> param);

	List<Sysopt> getByUserName(String userName);

	/** 该角色下是否已存在用户*/
	boolean ifUserRoleExist(String roelId);

	Map<String, Object> loginMethod(Map<String, Object> param);

	Map<String, Object> addMethod(Sysopt sysopt);

	Map<String, Object> updateMethod(Sysopt sysopt);

	Map<String, Object> updateManagerMethod(Sysopt sysopt);

	Map<String, Object> deleteMethod(String ids);

	boolean ifUserExist(Sysopt sysopt);

	List<Sysopt> list(String hql);

	Map<String, Object> creatAgtManager(TAgent tagent, String agtCode);

	Map<String, Object> creatComuManager(TCommunity tCommunity, String communityId, String roleId, String typeAPP);

	void updateManager(String adminUser, String roleId) throws Exception;

	Map<String, Object> resetPasswordMethod(Sysopt sysopt);

	Map<String, Object> updatePasswordMethod(String sid, String oldPassword, String newPassword);

	Map<String, Object> sendSMSVaildCodeMethod(String phone);

	Sysopt getByAppUserid(String appUserid) throws NotUniqueException;


	Map<String, Object>  loginBySysopt(Sysopt opt);



//todo --------------------------------------------------------------------------------------

    /**
	 * 操作人列表（下拉）
     * @author Saber
     * @Date 2017/8/2 上午11:05
     * @param type      类型 allComu:小区级、area:区域经理, 空:内部账号
     * @param user      当前用户
	 * @param userRole  当前用户userRole
	 * @return
	 */
	List<SysoptSelectListVO> selectList(String type, Sysopt user, int userRole);
}
